package pro.cherish.knowledgecmomon.entity;

/**
 * @author 创建人：cherish
 * @version 版本号：V1.0
 * <p>
 * ***************************修订记录************************************
 * 2019-11-02 cherish 创建该类功能。
 * **********************************************************************
 * </p>
 * @ClassName 类名：DictItem
 * @Description 功能说明：
 * <p>
 * TODO
 * </p>
 * **********************************************************************
 * @date 创建日期： 2019-11-02 cherish
 */

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel("字典项")
public class DictItem implements Comparable<DictItem>, Serializable {

    private static final long serialVersionUID = -7678116885400146537L;
    @ApiModelProperty(value = "字典项ID")
    private String itemId;
    @ApiModelProperty(value = "字典项编码")
    private String itemCode;
    @ApiModelProperty(value = "字典项名称")
    private String itemName;
    @ApiModelProperty(value = "字典项父OD")
    private String itemPid;
    @ApiModelProperty(value = "字典项父名称")
    private String itemPname;

//	@ApiModelProperty(value = "属性对象")
//	private Object attributes;

    @ApiModelProperty(value = "是否选中")
    private boolean checked = false;

    @ApiModelProperty(value = "是否展开")
    private boolean opened = false;

    @ApiModelProperty(value = "是否叶子节点")
    private boolean leaf;

    @ApiModelProperty(value = "级数（从1开始）")
    private Integer rank;

    @ApiModelProperty(value = "子节点")
    private List<DictItem> children = new ArrayList<DictItem>();

    @Override
    public int compareTo(DictItem dictItem) {
        return this.getItemId().compareTo(dictItem.getItemId());
    }
}

